<script lang="ts" setup>
  import { Col, Row } from '@sscd/grid';
</script>

<template>
  <div class="demo">
    <div class="demo-title">排序</div>
    <div class="demo-content">
      <p>Normal</p>
      <Row class="row" type="flex">
        <Col class="col odd" :span="6" :order="4">1 col-order-4</Col>
        <Col class="col even" :span="6" :order="3">2 col-order-3</Col>
        <Col class="col odd" :span="6" :order="2">3 col-order-2</Col>
        <Col class="col even" :span="6" :order="1">4 col-order-1</Col>
      </Row>
      <p>Responsive</p>
      <Row class="row" type="flex">
        <Col
          class="col odd"
          :span="6"
          :xs="{ order: 1 }"
          :sm="{ order: 2 }"
          :md="{ order: 3 }"
          :lg="{ order: 4 }"
        >
          1 col-order-responsive
        </Col>
        <Col
          class="col even"
          :span="6"
          :xs="{ order: 2 }"
          :sm="{ order: 1 }"
          :md="{ order: 4 }"
          :lg="{ order: 3 }"
        >
          2 col-order-responsive
        </Col>
        <Col
          class="col odd"
          :span="6"
          :xs="{ order: 3 }"
          :sm="{ order: 4 }"
          :md="{ order: 2 }"
          :lg="{ order: 2 }"
        >
          3 col-order-responsive
        </Col>
        <Col
          class="col even"
          :span="6"
          :xs="{ order: 4 }"
          :sm="{ order: 3 }"
          :md="{ order: 1 }"
          :lg="{ order: 1 }"
        >
          4 col-order-responsive
        </Col>
      </Row>
    </div>
  </div>
</template>

<style lang="less" scoped>
  .demo {
    :deep(.row) {
      margin-bottom: 12px;
      .col {
        padding: 16px 0;
        text-align: center;
        color: #fff;
        &.odd {
          background: rgba(0, 146, 255, 0.75);
        }
        &.even {
          background: #0092ff;
        }
      }
    }
  }
</style>
